# $Id: PKGBUILD 66242 2012-02-23 05:15:17Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Niel Drummond <niel.drummond@grumpytoad.org>

pkgname=mtasc
pkgver=20091229
pkgrel=4
pkgdesc="An open source flash (swf) compiler"
arch=(i686 x86_64)
url="http://mtasc.org/"
license=('GPL2')
depends=('zlib')
makedepends=('ocaml' 'cvs')
source=("http://arch.p5n.pp.ru/~sergej/dl/mtasc-$pkgver-1.tar.gz")
md5sums=('e3b1f31ae906ebbd92678fdac0fdd411')

build() {
  cd $srcdir/mtasc-$pkgver
  (cd ocaml/extc && make)
  ocaml install.ml
}

package() {
  cd $srcdir/mtasc-$pkgver
  install -D -m755 $srcdir/mtasc-$pkgver/bin/${pkgname} $pkgdir/usr/bin/${pkgname}
  for f in $( cd ocaml/mtasc/ && find ./{std,std8} -type f -iname '*.as' | grep -iv cvs ); do
    install -D -m644 ocaml/mtasc/$f $pkgdir/usr/share/mtasc/$f
  done
}
